
export const questionGroupType = "题库分组";

export function removeDifficulty(
    DATAdifficulty: Record<string, string>,
    questiondifficulty: string[] = []
): { labelObj: Record<string, string>; value: string[] } {
    console.log('Removing difficulties:', questiondifficulty);
    
    // 使用 reduce 来过滤掉指定的难度项，避免多次对象拷贝
    const labelObj = Object.keys(DATAdifficulty).reduce((acc, key) => {
        if (!questiondifficulty.includes(key)) {
            acc[key] = DATAdifficulty[key];  // 只有不在 questiondifficulty 中的项才被保留
        }
        return acc;
    }, {} as Record<string, string>);

    // 直接返回所需结果结构
    return { labelObj, value: Object.keys(labelObj) };
}


